package cl.ccs.migracionbcmc.util;

import java.util.HashMap;

public class RenewCode {
    
    private final static RenewCode INSTANCE = new RenewCode();
    private final static HashMap<String, String> RENEW;
    private final static HashMap<String, String> CONTRACT;
    private final static String INVALID = "";
    
    
    static {
        RENEW = new HashMap<String, String>();
        CONTRACT = new HashMap<String, String>();
        
        RENEW.put("ARM", "RAO");
        RENEW.put("ARW", "RAO");
        RENEW.put("ADM", "RDO");
        RENEW.put("ADW", "RDO");
        RENEW.put("AMM", "RMO");
        RENEW.put("AMW", "RMO");
        RENEW.put("PRM", "RPO");
        RENEW.put("PRW", "RPO");
        RENEW.put("CRM", "RRO");
        
        CONTRACT.put("ARM", "ARM");
        CONTRACT.put("ARW", "ARW");
        CONTRACT.put("ADM", "ADM");
        CONTRACT.put("ADW", "ADW");
        CONTRACT.put("AMM", "AMM");
        CONTRACT.put("AMW", "AMW");
        CONTRACT.put("PRM", "ARW");
        CONTRACT.put("PRW", "ARW");
        CONTRACT.put("CRM", "ARW");
        
    }

    public static RenewCode getInstance() {
        return INSTANCE;
    }
    
    private RenewCode() {
        super();
    }
    
    public String getRenewServiceCode(String teAvisaCode) {
        if (RENEW.containsKey(teAvisaCode)) {
            return RENEW.get(teAvisaCode);
        }
        return INVALID;
    }
    
    public String getContractRenewServiceCode(String teAvisaCode) {
        if (CONTRACT.containsKey(teAvisaCode)) {
            return CONTRACT.get(teAvisaCode);
        }
        return INVALID;
    }
}
